package top.laoshuzi.android.tts.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class GlobalReceiver extends BroadcastReceiver {
    public GlobalReceiver() {
    }

    @Override
    public void onReceive(Context context, Intent intent) {

        Log.w("ttsService", intent.getAction());
        if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
            Log.w("ttsService", "系统启动完成");

            Intent ttsIntent = new Intent("top.laoshuzi.android.services.TTS_SERVICE");
            ttsIntent.setPackage("top.laoshuzi.android.tts");
            context.startService(ttsIntent);
        }

    }
}
